﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GroupScheduler.aspx.cs"
    Inherits="GroupScheduler" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="DoctorScheduler">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="DoctorScheduler" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1"
        CssClass="exampleContainer">
        گروه بندی:
        <telerik:RadComboBox runat="Server" ID="GroupingDirectionComboBox" Skin="Vista" OnSelectedIndexChanged="GroupingDirectionComboBox_SelectedIndexChanged"
            AutoPostBack="True">
            <Items>
                <telerik:RadComboBoxItem Text="Horizontal" Value="Horizontal"></telerik:RadComboBoxItem>
                <telerik:RadComboBoxItem Text="Vertical" Value="Vertical"></telerik:RadComboBoxItem>
            </Items>
        </telerik:RadComboBox>
        <telerik:RadScheduler runat="server" ID="DoctorScheduler" GroupBy="Doctor" GroupingDirection="Horizontal"
            OnResourceHeaderCreated="DoctorScheduler_ResourceHeaderCreated" Width="100%"
            Height="100%" DataSourceID="AppointmentsEntityDataSource" DataKeyField="Id" DataSubjectField="Subject"
            DataStartField="Start" DataEndField="End" OnFormCreated="DoctorScheduler_FormCreated"
            OverflowBehavior="Auto" OnFormCreating="DoctorScheduler_FormCreating" FirstDayOfWeek="Saturday"
            HoursPanelTimeFormat="H:mm" LastDayOfWeek="Thursday" TimeZoneID="Iran Standard Time"
            Skin="Office2010Blue" TimeZoneOffset="03:30:00" ShowFullTime="false" NumberOfHoveredRows="0"
            EnableRecurrenceSupport="false" AppointmentStyleMode="Default">
            <AdvancedForm Modal="true"></AdvancedForm>
            <MonthView UserSelectable="false"></MonthView>
            <ResourceHeaderTemplate>
                <asp:Panel ID="ResourceImageWrapper" runat="server" CssClass="ResCustomClass">
                    <asp:Image ID="DoctorImage" runat="server"></asp:Image>
                </asp:Panel>
            </ResourceHeaderTemplate>
            <ResourceTypes>
                <telerik:ResourceType KeyField="Id" Name="Room" TextField="Name" ForeignKeyField="RoomId"
                    DataSourceID="RoomsEntityDataSource"></telerik:ResourceType>
                <telerik:ResourceType KeyField="Id" Name="Doctor" TextField="FirstName" ForeignKeyField="DoctorId"
                    DataSourceID="DoctorsEntityDataSource"></telerik:ResourceType>
                <telerik:ResourceType KeyField="Id" Name="AppointmentType" TextField="Name" ForeignKeyField="AppointmentTypeId"
                    DataSourceID="AppointmentTypesEntityDataSource"></telerik:ResourceType>
            </ResourceTypes>
            <ResourceStyles>
                <telerik:ResourceStyleMapping Type="Doctor" Key="1" BackColor="#eb901b"></telerik:ResourceStyleMapping>
                <telerik:ResourceStyleMapping Type="Doctor" Key="2" BackColor="#8fd21b"></telerik:ResourceStyleMapping>
                <telerik:ResourceStyleMapping Type="Doctor" Key="3" BackColor="#278ce9"></telerik:ResourceStyleMapping>
                <telerik:ResourceStyleMapping Type="Doctor" Key="4" BackColor="#f14db2"></telerik:ResourceStyleMapping>
            </ResourceStyles>
            <TimeSlotContextMenuSettings EnableDefault="true"></TimeSlotContextMenuSettings>
            <AppointmentContextMenuSettings EnableDefault="true"></AppointmentContextMenuSettings>
            <InlineInsertTemplate>
                <div id="qsfexAdvEditWrapper">
                    <div id="qsfexAdvEditInnerWrapper" class="technical">
                        <div class="qsfexAdvAppType">
                        </div>
                        <div class="qsfexAdvEditControlWrapper">
                            <asp:Label ID="Label4" AssociatedControlID="SubjectTextBox" runat="server" CssClass="inline-label">عنوان: </asp:Label>
                            <asp:TextBox ID="SubjectTextBox" Rows="2" Columns="20" runat="server" Text='<%# Bind("Subject") %>'
                                Width="97%" TextMode="MultiLine"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="SubjectRequiredFieldValidator" runat="server" ValidationGroup="Insert"
                                ControlToValidate="SubjectTextBox" ErrorMessage="عنوان اجباری">*</asp:RequiredFieldValidator>
                            <br />
                        </div>
                        <div class="qsfexAdvEditControlWrapper">
                            <asp:Label ID="Label5" AssociatedControlID="StartInput" runat="server" CssClass="inline-label">زمان شروع:</asp:Label>
                            <telerik:RadDateInput ID="StartInput" SelectedDate='<%# Bind("Start") %>' runat="server"
                                EnableSingleInputRendering="false">
                            </telerik:RadDateInput>
                            <br />
                        </div>
                        <div class="qsfexAdvEditControlWrapper">
                            <asp:Label ID="Label6" AssociatedControlID="EndInput" runat="server" CssClass="inline-label">زمان پایان:</asp:Label>
                            <telerik:RadDateInput ID="EndInput" SelectedDate='<%# Bind("End") %>' runat="server"
                                EnableSingleInputRendering="false">
                            </telerik:RadDateInput><br />
                        </div>
                        <div class="qsfexAdvEditControlWrapper">
                            <asp:Label ID="Label3" AssociatedControlID="AppointmentTypeComboBox" runat="server"
                                CssClass="inline-label">نوع ملاقات:</asp:Label>
                            <telerik:RadComboBox runat="server" ID="AppointmentTypeComboBox" DataTextField="Name"
                                DataValueField="Id" Width="90%" Skin="Office2007" SelectedValue='<%# Bind("AppointmentTypeId") %>'
                                DataSourceID="AppointmentTypesEntityDataSource">
                            </telerik:RadComboBox>
                            <asp:DropDownList ID="DropDownList1" runat="server" DataTextField="Name" DataValueField="Id"
                                Width="90%" SelectedValue='<%# Bind("AppointmentTypeId") %>' DataSourceID="AppointmentTypesEntityDataSource">
                            </asp:DropDownList>
                        </div>
                        <div class="qsfexAdvEditControlWrapper">
                            <asp:Label ID="Label1" AssociatedControlID="DoctorsComboBox" runat="server" CssClass="inline-label">نام پزشک:</asp:Label>
                            <telerik:RadComboBox runat="server" ID="DoctorsComboBox" DataTextField="FirstName"
                                DataValueField="Id" Width="90%" Skin="Office2007" SelectedValue='<%# Bind("DoctorId") %>'
                                DataSourceID="DoctorsEntityDataSource">
                            </telerik:RadComboBox>
                        </div>
                        <div class="qsfexAdvEditControlWrapper">
                            <asp:Label ID="Label2" AssociatedControlID="RoomsComboBox" runat="server" CssClass="inline-label">محل حضور:</asp:Label>
                            <telerik:RadComboBox runat="server" ID="RoomsComboBox" DataTextField="Name" DataValueField="Id"
                                Width="90%" Skin="Office2007" SelectedValue='<%# Bind("RoomId") %>' DataSourceID="RoomsEntityDataSource">
                            </telerik:RadComboBox>
                        </div>
                        <div class="qsfexAdvEditControlWrapper">
                            <asp:LinkButton ID="InsertButton" runat="server" CommandName="Insert">
                                <asp:Image runat="server" ID="Image4" ValidationGroup="Insert" ImageUrl="App_Themes/Default/Images/ok.png"
                                    AlternateText="insert"></asp:Image></asp:LinkButton>
                            <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                                Style="margin-right: 8px;">
                                <asp:Image runat="server" ID="Image5" ImageUrl="App_Themes/Default/Images/cancel.png"
                                    AlternateText="cancel"></asp:Image></asp:LinkButton>
                        </div>
                    </div>
                </div>
            </InlineInsertTemplate>
            <AdvancedEditTemplate>
                <div id="qsfexAdvEditWrapper">
                    <div id="qsfexAdvEditInnerWrapper" class="technical">
                        <div class="qsfexAdvAppType">
                        </div>
                        <div class="qsfexAdvEditControlWrapper">
                            <asp:Label ID="Label4" AssociatedControlID="SubjectTextBox" runat="server" CssClass="inline-label">عنوان: </asp:Label>
                            <asp:TextBox ID="SubjectTextBox" Rows="2" Columns="20" runat="server" Text='<%# Bind("Subject") %>'
                                Width="97%" TextMode="MultiLine"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="SubjectRequiredFieldValidator" runat="server" ValidationGroup="Update"
                                ControlToValidate="SubjectTextBox" ErrorMessage="عنوان اجباری">*</asp:RequiredFieldValidator>
                            <br />
                        </div>
                        <div class="qsfexAdvEditControlWrapper">
                            <asp:Label ID="Label5" AssociatedControlID="StartInput" runat="server" CssClass="inline-label">زمان شروع:</asp:Label>
                            <telerik:RadDateInput ID="StartInput" SelectedDate='<%# Bind("Start") %>' runat="server"
                                EnableSingleInputRendering="false">
                            </telerik:RadDateInput><br />
                        </div>
                        <div class="qsfexAdvEditControlWrapper">
                            <asp:Label ID="Label6" AssociatedControlID="EndInput" runat="server" CssClass="inline-label">زمان پایان:</asp:Label>
                            <telerik:RadDateInput ID="EndInput" SelectedDate='<%# Bind("End") %>' runat="server"
                                EnableSingleInputRendering="false">
                            </telerik:RadDateInput><br />
                        </div>
                        <div class="qsfexAdvEditControlWrapper">
                            <asp:Label ID="Label3" AssociatedControlID="AppointmentTypeComboBox" runat="server"
                                CssClass="inline-label">نوع ملاقات:</asp:Label>
                            <telerik:RadComboBox runat="server" ID="AppointmentTypeComboBox" DataTextField="Name"
                                DataValueField="Id" Width="90%" Skin="Office2007" SelectedValue='<%# Bind("AppointmentTypeId") %>'
                                DataSourceID="AppointmentTypesEntityDataSource">
                            </telerik:RadComboBox>
                        </div>
                        <div class="qsfexAdvEditControlWrapper">
                            <asp:Label ID="Label1" AssociatedControlID="DoctorsComboBox" runat="server" CssClass="inline-label">نام پزشک:</asp:Label>
                            <telerik:RadComboBox runat="server" ID="DoctorsComboBox" DataTextField="FirstName"
                                DataValueField="Id" Width="90%" Skin="Office2007" SelectedValue='<%# Bind("DoctorId") %>'
                                DataSourceID="DoctorsEntityDataSource">
                            </telerik:RadComboBox>
                        </div>
                        <div class="qsfexAdvEditControlWrapper">
                            <asp:Label ID="Label2" AssociatedControlID="RoomsComboBox" runat="server" CssClass="inline-label">محل حضور:</asp:Label>
                            <telerik:RadComboBox runat="server" ID="RoomsComboBox" DataTextField="Name" DataValueField="Id"
                                Width="90%" Skin="Office2007" SelectedValue='<%# Bind("RoomId") %>' DataSourceID="RoomsEntityDataSource">
                            </telerik:RadComboBox>
                        </div>
                        <div class="qsfexAdvEditControlWrapper">
                            <asp:LinkButton ID="UpdateButton" runat="server" CommandName="Update">
                                <asp:Image runat="server" ID="Image4" ValidationGroup="Update" ImageUrl="App_Themes/Default/Images/ok.png"
                                    AlternateText="update"></asp:Image></asp:LinkButton>
                            <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                                Style="margin-right: 8px;">
                                <asp:Image runat="server" ID="Image5" ImageUrl="App_Themes/Default/Images/cancel.png"
                                    AlternateText="cancel"></asp:Image></asp:LinkButton>
                        </div>
                    </div>
                </div>
            </AdvancedEditTemplate>
        </telerik:RadScheduler>
    </telerik:RadAjaxPanel>
    <asp:EntityDataSource ID="AppointmentsEntityDataSource" runat="server" ConnectionString="name=DatabaseEntities"
        DefaultContainerName="DatabaseEntities" EntitySetName="Appointments" EnableDelete="True"
        EnableInsert="True" EnableUpdate="True">
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="AppointmentTypesEntityDataSource" runat="server" ConnectionString="name=DatabaseEntities"
        DefaultContainerName="DatabaseEntities" EntitySetName="AppointmentTypes">
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="RoomsEntityDataSource" runat="server" ConnectionString="name=DatabaseEntities"
        DefaultContainerName="DatabaseEntities" EntitySetName="Rooms">
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="DoctorsEntityDataSource" runat="server" ConnectionString="name=DatabaseEntities"
        DefaultContainerName="DatabaseEntities" EntitySetName="Doctors">
    </asp:EntityDataSource>
    </form>
</body>
</html>
